package com.furongji.common.exception;

import com.furongji.common.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(MyException.class)
    public Result error(MyException e) {
        e.printStackTrace();
        return Result.error(e.getCode(), e.getMessage());
    }
}
